﻿<Menu
    x:Class="YALV.View.Components.MainMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:recentList="clr-namespace:YALV.Common"
    xmlns:strs="clr-namespace:YalvLib.Strings;assembly=YalvLib"

    mc:Ignorable="d"
    
    d:DesignHeight="300"
    d:DesignWidth="300"
    Background="Transparent"
    Height="20"
    BorderThickness="0,0,0,1"
    BorderBrush="{StaticResource BorderColor}">
    <!-- File Items -->
    <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_Header}">
        <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_OpenFile_Header}"
                  Command="{Binding Path=CommandOpenFile}"
                  CommandParameter="OPEN">
        </MenuItem>
        <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_OpenSqliteDatabase_Header}"
                  Command="{Binding Path=CommandOpenSqliteDatabase}"
                  CommandParameter="OPEN">
        </MenuItem>
        <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_OpenLogAnalysisSession_Header}"
                  Command="{Binding Path=CommandOpenLogAnalysisSession}"
                  CommandParameter="OPEN">
        </MenuItem>

        <Separator />
        <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_RecentFiles_Header}">
            <recentList:RecentFileList x:Name="RecentFileListMenu" />
        </MenuItem>
        <Separator />
        <MenuItem 
            Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_ExportToSqlite_Header}"
            Command="{Binding Path=CommandExport}">
        </MenuItem>
        <Separator />

        <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_FileMenu_Exit_Header}"
              Command="{Binding Path=CommandExit}"
              InputGestureText="Alt+F4">
        </MenuItem>
    </MenuItem>

    <!-- View Items -->
    <MenuItem Header="{x:Static strs:Resources.Common_Components_MainMenu_ViewMenu_Header}">
        <MenuItem
            Header="{x:Static strs:Resources.Common_Components_MainMenu_ViewMenu_RefreshLog_Header}"
            Command="{Binding Path=YalvLogViewModel.CommandRefresh}"
            InputGestureText="F5">
        </MenuItem>
        <MenuItem
            Header="{x:Static strs:Resources.Common_Components_MainMenu_ViewMenu_ClearFilters_Header}"
            Command="{Binding Path=YalvLogViewModel.LogEntryRows.CommandClearFilters}"
            InputGestureText="Ctrl+D">
        </MenuItem>
        <MenuItem
            Header="{x:Static strs:Resources.Common_Components_MainMenu_ViewMenu_DeleteFile_Header}"
            Command="{Binding Path=YalvLogViewModel.CommandDelete}"
            InputGestureText="DEL">
        </MenuItem>

        <MenuItem ItemsSource="{Binding Path=LogEntryRows.DataGridColumns.DataGridColumns}"
                Header="Columns"
                DataContext="{Binding YalvLogViewModel}">
            <MenuItem.ItemContainerStyle>
                <Style TargetType="{x:Type MenuItem}">
                    <Setter Property="IsChecked" Value="{Binding IsColumnVisible}" />
                    <Setter Property="IsCheckable" Value="True" />
                    <Setter Property="Header" Value="{Binding Header}" />
                </Style>
            </MenuItem.ItemContainerStyle>
        </MenuItem>
    </MenuItem>

    <!-- About Items -->
    <MenuItem
        Header="{x:Static strs:Resources.Common_Components_MainMenu_AboutMenu_Header}"
        Command="{Binding Path=CommandAbout}">
    </MenuItem>
</Menu>